#include "config.h"
#include "GPIO_InIt.h"
#include "IR_Exit.h"
#include "eeprom.h"

unsigned char Address;
unsigned char Command;

u16 i;
u8 num[] = {0x01,0x02};
u8 nums[] = 0;
void UART_config(void)
{
	COMx_InitDefine		COMx_InitStructure;					
	COMx_InitStructure.UART_Mode      = UART_8bit_BRTx;
	COMx_InitStructure.UART_BRT_Use   = BRT_Timer1;
	COMx_InitStructure.UART_BaudRate  = 9600;
	COMx_InitStructure.UART_RxEnable  = ENABLE;
	COMx_InitStructure.BaudRateDouble = DISABLE;
	COMx_InitStructure.UART_Interrupt = ENABLE;
	COMx_InitStructure.UART_Priority  = Priority_0;
	COMx_InitStructure.UART_P_SW      = UART1_SW_P30_P31;
	UART_Configuration(UART1, &COMx_InitStructure);
	EA=1;//中断总开关
}

void main()
{
	GPIO_Init();
	UART_config();
//	EEPROM_SectorErase(0x0000);//擦除	
//	Delay_ms(1);
//	EEPROM_write_n(0x0000,num,2);//写入
//	Delay_ms(1);
	EEPROM_read_n(0x0000,nums,2);
	while(1)
	{
		
		Delay_ms(1000);
		TX1_write2buff(nums[0]);
		TX1_write2buff(nums[1]);	
	}
}




	
